package com.dynamic.idea.quick.develop.plugin.entity.base;

/**
 * provider的实现的结构，若没有provider，则仅生成dao,xml,service,impl
 */
public class ProjectStructProviderImplEntity extends BaseStructEntity {

    /** mapperXml层的包名,默认是mapper */
    private String mapperXmlName="mapper";

    /** mapper的后缀,默认是Mapper */
    private String mapperSuffix="Mapper";

    /** DAO层的包名,默认是dao */
    private String daoName="dao";

    /** dao的后缀,默认是Mapper */
    private String daoSuffix="Mapper";

    /** service层的包名,默认是service */
    private String serviceName="service";

    /** service的后缀,默认是Service */
    private String serviceSuffix="Service";

    /** service的实现层包名，在service下 */
    private String serviceImplName="impl";

    /** Service实现的后缀,默认是ServiceImpl */
    private String serviceImplSuffix="ServiceImpl";

    /** provider层的包名,默认是provider */
    private String providerImplName="provider";

    /** provider实现的后缀,默认是ProviderImpl */
    private String providerImplSuffix="ProviderImpl";

    /**
     * 得到DAO定义的路径
     * @return
     */
    public String getDAOPath() {
        return getRealPath(getSrcMainJavaBasePackagePath(),daoName);
    }

    /**
     * 得到DAO定义的类名
     * @return
     */
    public String getDAOClassName(){
        return className+daoSuffix;
    }
    /**
     * 得到DAO定义的全限定名
     * @return
     */
    public String getDAOClassFullName(){
        return basePackageName+"."+daoName+"."+getDAOClassName();
    }

    /**
     * 得到DAO的类定义的路径
     * @return
     */
    public String getDAOClassPath(){
        return getRealPath(getDAOPath(),getDAOClassName())+".java";
    }

    /**
     * 得到 MapperXML定义的路径
     * @return
     */
    public String getMapperXmlPath() {
        return getRealPath(getSrcMainResourcesBasePackagePath(),mapperXmlName);
    }

    /**
     * 得到 MapperXML定义的文件名
     * @return
     */
    public String getMapperXmlFileName(){
        return className+mapperSuffix;
    }

    /**
     * 得到 MapperXml的文件定义的路径
     * @return
     */
    public String getMapperXmlFilePath(){
        return getRealPath(getMapperXmlPath(),getMapperXmlFileName())+".xml";
    }

    /**
     * 得到 Service定义的路径
     * @return
     */
    public String getServicePath() {
        return getRealPath(getSrcMainJavaBasePackagePath(),serviceName);
    }

    /**
     * 得到 Service定义的类名
     * @return
     */
    public String getServiceClassName(){
        return className+serviceSuffix;
    }
    /**
     * 得到 Service定义的全限定类名
     * @return
     */
    public String getServiceClassFullName(){
        return basePackageName+"."+serviceName+"."+getServiceClassName();
    }

    /**
     * 得到 Service的类定义的路径
     * @return
     */
    public String getServiceClassNamePath(){
        return getRealPath(getServicePath(),getServiceClassName())+".java";
    }


    /**
     * 得到 ServiceImpl定义的路径
     * @return
     */
    public String getServiceImplPath() {
        return getRealPath(getSrcMainJavaBasePackagePath(),serviceImplName);
    }

    /**
     * 得到 ServiceImpl定义的类名
     * @return
     */
    public String getServiceImplClassName(){
        return className+serviceImplSuffix;
    }

    /**
     * 得到 ServiceImpl定义的全限定类名
     * @return
     */
    public String getServiceImplClassFullName(){
        return basePackageName+"."+serviceImplName+"."+getServiceImplClassName();
    }


    /**
     * 得到 Service的类定义的路径
     * @return
     */
    public String getServiceImplClassNamePath(){
        return getRealPath(getServiceImplPath(),getServiceImplClassName())+".java";
    }

    /**
     * 得到 ProviderImpl定义的路径
     * @return
     */
    public String getProviderImplPath() {
        return getRealPath(getSrcMainJavaBasePackagePath(),providerImplName);
    }

    /**
     * 得到 ProviderImpl定义的类名
     * @return
     */
    public String getProviderImplClassName(){
        return className+providerImplSuffix;
    }

    /**
     * 得到 ProviderImpl定义的全限定类名
     * @return
     */
    public String getProviderImplClassFullName(){
        return basePackageName+"."+providerImplName+"."+getProviderImplClassName();
    }

    /**
     * 得到 ProviderImpl的类定义的路径
     * @return
     */
    public String getProviderImplClassNamePath(){
        return getRealPath(getProviderImplPath(),getProviderImplClassName())+".java";
    }

    // get/set 方法

    public String getMapperXmlName() {
        return mapperXmlName;
    }

    public void setMapperXmlName(String mapperXmlName) {
        this.mapperXmlName = mapperXmlName;
    }

    public String getMapperSuffix() {
        return mapperSuffix;
    }

    public void setMapperSuffix(String mapperSuffix) {
        this.mapperSuffix = mapperSuffix;
    }

    public String getDaoName() {
        return daoName;
    }

    public void setDaoName(String daoName) {
        this.daoName = daoName;
    }

    public String getDaoSuffix() {
        return daoSuffix;
    }

    public void setDaoSuffix(String daoSuffix) {
        this.daoSuffix = daoSuffix;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getServiceSuffix() {
        return serviceSuffix;
    }

    public void setServiceSuffix(String serviceSuffix) {
        this.serviceSuffix = serviceSuffix;
    }

    public String getServiceImplName() {
        return serviceImplName;
    }

    public void setServiceImplName(String serviceImplName) {
        this.serviceImplName = serviceImplName;
    }

    public String getServiceImplSuffix() {
        return serviceImplSuffix;
    }

    public void setServiceImplSuffix(String serviceImplSuffix) {
        this.serviceImplSuffix = serviceImplSuffix;
    }

    public String getProviderImplName() {
        return providerImplName;
    }

    public void setProviderImplName(String providerImplName) {
        this.providerImplName = providerImplName;
    }

    public String getProviderImplSuffix() {
        return providerImplSuffix;
    }

    public void setProviderImplSuffix(String providerImplSuffix) {
        this.providerImplSuffix = providerImplSuffix;
    }
}

